using I2.Loc;
using UnityEngine;

public class MyPlayerInLeaderBoardPanel : MonoBehaviour
{
	[SerializeField]
	private UILabel placeLabel;

	[SerializeField]
	private UILabel loginLabel;

	[SerializeField]
	private UILabel leagueLabel;

	[SerializeField]
	private UILabel starsLabel;

	private LeaderInfo _playerInfo;

	private GameObject _placeInGrid;

	private UICenterOnChild _centerOnChaild;

	private UIScrollView _scroll;

	public GameObject PlaceInGrid
	{
		get
		{
			return _placeInGrid;
		}
		set
		{
			_placeInGrid = value;
		}
	}

	public UICenterOnChild CenterOnChaild
	{
		get
		{
			return _centerOnChaild;
		}
		set
		{
			_centerOnChaild = value;
		}
	}

	public UIScrollView Scroll
	{
		get
		{
			return _scroll;
		}
		set
		{
			_scroll = value;
		}
	}

	public void Init(LeaderInfo player)
	{
		_playerInfo = player;
		placeLabel.text = player.place.ToString();
		loginLabel.text = player.nickName;
		leagueLabel.text = ScriptLocalization.Get("Game_Common/" + player.league);
		starsLabel.text = player.stars.ToString();
	}

	public void HideLeagueLabel()
	{
		leagueLabel.gameObject.SetActive(false);
	}

	private void OnClick()
	{
		CenterOnChaild.Recenter();
		CenterOnChaild.CenterOn(PlaceInGrid.transform);
	}
}
